<template>
    <div id="app">
      <el-form :model="studentWorkhome" label-width="100px"  ref="abc">
        <el-form-item label="作业分数" prop="score">
          <el-input v-model="studentWorkhome.score"></el-input>
        </el-form-item>

        <el-form-item label="作业描述" prop="teacherDescription">
          <el-input v-model="studentWorkhome.teacherDescription"  type="textarea" rows="5"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click.prevent="test">保存</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
      data(){
        return {
          studentWorkhome:{}
        }
      },
      methods:{
        test(){
            this.$confirm("是否确认提交","保存提示").then(()=>{
              this.axios.post("/studentWorkhome/updateHomework",this.studentWorkhome).then((resp)=>{
                  this.$message.success("保存成功！");
                  this.$router.push("/studentWorkhome/selectByWorkhome?wid="+this.studentWorkhome.wid)
                });
            }).catch(()=>{});
        }
      },
      created(){
        this.studentWorkhome.id=this.$route.query.swid;
        this.studentWorkhome.wid=this.$route.query.wid;
      }
    }
</script>


<style scoped>

</style>
